import {getEnvValue} from '@/utils/env';

export function uploadFilePromise(url) {
    return new Promise((resolve, reject) => {
        let a = uni.uploadFile({
            url: getEnvValue<string>('VITE_UPLOAD_URL'), // 仅为示例，非真实的接口地址
            filePath: url,
            name: 'file',
            formData: {},
            success: (res) => {
                resolve(JSON.parse(res.data).data)
            }
        });
    })
}